package com.docmanage.common.enums;

/**
 * @author yhd
 * @create 2023/12/10 14:30
 */
public enum StatusEnums {

    /*审批状态 0、未提交 1、审批中   2、同意  3、被驳回  4、借出  5、已归还  */
    ZERO("0","未提交"),ONE("1","审批中"),TOW("2","同意"),THREE("3","被驳回"),FOUR("4","借出"),FIVE("5","已归还");

    private String code;

    private String name;

    StatusEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static StatusEnums getNameByCode(String code){
        for (StatusEnums statusEnums: values()){
            if (statusEnums.getCode().equals(code)){
                return statusEnums;
            }
        }
        return ZERO;
    }
}
